package com.zsc.shixun.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * <p>
 *
 * </p>
 *
 * @author ZWYZY
 * @since 2020/6/26
 */
@Configuration
public class EsConfig {
    //localhost:9200 写在配置文件中就可以了
    @Bean
    RestHighLevelClient elasticsearchClient() {
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(new HttpHost("120.25.157.203", 9200, "http"))
        );

        return client;
    }
}
